package com.slipper.system.dictionary;

import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.slipper.system.api.dictionary.bo.DictionaryDataBO;
import com.slipper.system.api.dictionary.bo.DictionaryDataBOs;
import com.slipper.system.api.dictionary.service.IDictionaryDataSv;
import com.slipper.common.permit.PermitAll;
import com.slipper.common.util.ResultUtil;

/**
 * 字典数据信息
 * 
 * @date 2019-10-03 14:02:09
 */
@RestController
@RequestMapping("/dictionaryData")
public class DictionaryDataController {
    @Resource
    private IDictionaryDataSv dictionaryDataSv;

    @PermitAll
    @PostMapping("/queryPage")
    public String queryPage(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.toJson(dictionaryDataSv.queryPage(bo));
    }

    @PostMapping("/save")
    public String save(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.toJson(dictionaryDataSv.save(bo));
    }
    
    @PostMapping("/saves")
    public String saves(@RequestBody DictionaryDataBOs bos) {
        return ResultUtil.toJson(dictionaryDataSv.saves(bos));
    }

    @PostMapping("/queryBy")
    public String queryBy(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.toJson(dictionaryDataSv.queryBy(bo));
    }

    @PostMapping("/delete")
    public String delete(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.toJson(dictionaryDataSv.delete(bo));
    }
    
    @PermitAll
    @PostMapping("/saveByCode")
    public String saveByCode(@RequestBody DictionaryDataBOs bos) {
        return ResultUtil.toJson(dictionaryDataSv.saveByCode(bos));
    }
}
